Use Process.run instead of command operator#16780
Use Process.run instead of command operator#16780ysbaddaden wants to merge 3 commits intocrystal-lang:masterfrom
Process.run instead of command operator#16780Conversation
straight-shoota
left a comment
There was a problem hiding this comment.
question: Any reason for using Process(command, args) instead of the new Process.run(args) API? I think we should rather adapt the latter.
Process.run instead of command operator
|
None. It wasn't implemented when I wrote the original patch. BTW: changing to the other syntax, we should just have a class Process
def self.run(*args : String, **kwargs)
run(args, **kwargs)
end
end |
|
Let's add that to RFC 25! |
|
Why would the aarch64 CI fail? |
|
I reverted the change to $ make
$ bin/crystal spec spec/compiler/loader/unix_spec.cr
In src/crystal/system/unix/process.cr:314:21
314 | {pathname, argv.to_unsafe}
^--------
Error: undefined method 'to_unsafe' for Tuple(Pointer(UInt8), Pointer(UInt8), Pointer(UInt8), Pointer(UInt8), Pointer(UInt8), Pointer(UInt8))I guess the new API doesn't work with anything but Array? |
|
Yeah. Looks like we're not actually testing that the |
Allows to directly pass args and call the executable directly instead of quoting each arg and building a shell command indirection.
b830a5a to
3d7fc43
Compare
|
I removed the revert commit and replaced the Tuple an Array literal so we have |
Allows to directly pass args and call the executable instead of quoting each arg and building a shell command indirection.
Ref #16614.
Extracted from #16630.